package com.unicorn.vo;

import com.unicorn.entity.enums.ClientType;
import com.unicorn.entity.enums.DataStaus;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by windy on 16-11-3.
 */
public class BaseVO {

    public Long id;


    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    public Date createTime=new Date(System.currentTimeMillis());

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    public Date lastUpdateTime=new Date(System.currentTimeMillis());;

    @Column(columnDefinition = "int(1) NOT NULL")
    public DataStaus isDelete = DataStaus.EXIST;


    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    public Date deleteTime;

    public Long version=1l;

    /**
     * API 版本
     */
    public String apiVersion;
    /**
     * 客户端类型
     */
    @Enumerated(EnumType.STRING)
    public ClientType clientType;

    /**
     * 系统业务信息集合
     */
    public static final String MSG_LOAD_DATA_FAIL ="加载数据出错" ;

    public static final String MSG_MISS_DATA_ID ="数据ID缺失" ;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public DataStaus getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(DataStaus isDelete) {
        this.isDelete = isDelete;
    }

    public Date getDeleteTime() {
        return deleteTime;
    }

    public void setDeleteTime(Date deleteTime) {
        this.deleteTime = deleteTime;
    }

    public Long getVersion() {
        return version;
    }

    public String getApiVersion() {
        return apiVersion;
    }

    public void setApiVersion(String apiVersion) {
        this.apiVersion = apiVersion;
    }

    public ClientType getClientType() {
        return clientType;
    }

    public void setClientType(ClientType clientType) {
        this.clientType = clientType;
    }

    public void setVersion(Long version) {
        this.version = version;
    }
}
